package com.aaa.springboot.controller;

import com.aaa.springboot.commons.lang.Result;
import com.aaa.springboot.dao.PulishDao;
import com.aaa.springboot.pojo.Pulish;
import com.aaa.springboot.service.PulishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("pub")
public class PublishController {

    @Autowired
    private PulishService pulishService;

    @GetMapping("selectAll")
    public Result<List<Pulish>>  selectAll(){
        List<Pulish> pulishes = pulishService.selectAll();
        return  Result.ok(pulishes);

    }
}
